package mylib
{
	public class Print_r
	{
		  public static function r(str:*,strs:String=""):String {
			   var times:Date=new Date();
			   var str2:String;
			   str2=checkType(str,0);
			   str2=times.getHours()+":"+times.getMinutes()+":"+times.getSeconds()+">"+strs+str2;
			   trace(str2);
			   return str2;
		  }
		  private static function showObject(arr:Object,tableNum:Number):String {
			   var restr:String;
			   var space:String="";
			   for (var i:int=0; i<tableNum; i++) {
				    space+="\t";
			   }
			   restr="\n"+space+"{";
			   for (var vi in arr) {
				    restr+="\n"+space+vi+"=>"+checkType(arr[vi],tableNum);
			   }
			   restr+="\n"+space+"}\n";
			   return restr;
		  }
		  private static function checkType(str:*,tableNum:Number):String {
			   var str2:String;
			   if (str is Array) {
				    str2="Array:"+showObject(str,tableNum+1);
			   } else if (str is String) {
				    str2="String:"+str;
			   } else if (str is Boolean) {
				    str2="Boolean:"+str;
			   } else if (str is Number) {
				    str2="Number:"+str;
			   } else if (str is Function) {
				    str2="Function:";
			   } else if (str is Object) {
				    str2="Object:"+showObject(str,tableNum+1);
			   }
			   return str2;
		  }
	}
}